<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.5, user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="shortcut icon" href="/images/favicon.ico" />
	<link type="text/css" rel="stylesheet" href="/css/weui.min.css"/>
	<link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css"/>
	<style type="text/css">
		html,body,#wrapper,.wrapper{ height:100%; position:relative}
		.wrapper>div{height:100%}
		a{ text-decoration:none!important}
	</style>
	<link type="text/css" rel="stylesheet" href="/css/index.css"/>
	<link type="text/css" rel="stylesheet" href="/css/comment.css"/>
	<link type="text/css" rel="stylesheet" href="/css/setting.css"/>
	<% if(is_phone && wall.template) { %>
		<% if(wall.template=='path') { %>
			<link type="text/css" rel="stylesheet" href="/css/timeline.css"/>
		<% } %>
	<link type="text/css" rel="stylesheet" href="/css/<%= wall.template %>.css"/>
	<% } %>
	
	<title><%= wall.name %></title>
	<script type="text/javascript"  src="/js/i18next.min.js"></script>
	<script type="text/javascript"  src="/wall/<%= wall.id %>/app.js"></script>
	<script type="text/javascript"  src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script type="text/javascript">
		var wallId = '<%= wall.id %>';
		var appId = '<%= wall.app_id %>';
		var wallUserId = '<%= wall.wall_user_id %>';
		var wallName = '<%= wall.name %>';
		var wallDescription = unescape('<%= wall.description %>');
		var wallLogo='<%= wall.logo %>';
		var wallQrcode='<%= wall.qr_code %>';
		var isAdmin = <%= is_admin %>;
        var isAuthor = <%=is_author %>;
        var user_authority = <%= user_authority%>;
        var isAnoymous = <%= is_anonymous %>;
		var isWeChat = <%= is_wechat %>;
        var background = unescape('<%= wall.background %>');
		var isWxReady = false;
		var canUpload = true;
		var is_realtime = <%=is_realtime %>;
		var realtime_stop_timestamp = <%= realtime_stop_timestamp %>;
		var plan = <%- JSON.stringify(plan) %>;
		var wallTemplate = '<%= is_phone?wall.template:"mainlist" %>';
		var settings = <%- JSON.stringify(wall.settings || {}) %>;
		switch (user_authority){
			case 2:
				if(!isAuthor&&!isAdmin){
					canUpload=false
				}
				break;
			case 3:
				if(!isAdmin){
					canUpload=false
				}
				break;
		}

		wx.config({
			debug: false,
			appId: '<%= config.appId %>',
			timestamp: <%= config.timestamp %>,
			nonceStr: '<%= config.nonceStr %>',
			signature: '<%= config.signature %>',
			jsApiList: [
				'chooseImage',
				'uploadImage',
				'downloadImage',
				'openLocation',
				'getLocation',
				'onMenuShareTimeline',
            	'onMenuShareAppMessage',
            	'previewImage',
            	'onMenuShareQQ',
            	'onMenuShareWeibo'
			]
		});
		var wxError = "No error";
		wx.error(function(res) {
			wxError = res;
		});
		wx.ready(function() {
			isWxReady = true;
			wx.onMenuShareTimeline({
				title: wallName,
				link:location.href,
				imgUrl: 'http:'+ wallLogo,
				success: function () { 
					console.log('分享成功')
				},
				cancel: function () {
					console.log('分享失败')
				}
			});
			wx.onMenuShareAppMessage({
				title: wallName,
				desc: wallDescription,
				link:location.href,
				imgUrl: 'http:'+ wallLogo,
				type: '',
				dataUrl: '',
				success: function () { 
					console.log('分享成功')
				},
				cancel: function () { 
					console.log('分享失败')
				}
			});
			wx.onMenuShareQQ({
	            title: wallName,
	            desc: wallDescription,
	            link: location.href,
	            imgUrl: 'http:'+ wallLogo,
	            success: function () {
	                console.log('分享成功')
	            },
	            cancel: function () {
	                console.log('分享失败')
	            }
	        });
	        wx.onMenuShareWeibo({
	            title: wallName,
	            desc: wallDescription,
	            link: location.href,
	            imgUrl: 'http:'+ wallLogo,
	            success: function () {
	                console.log('分享成功')
	            },
	            cancel: function () {
	                console.log('分享失败')
	            }
	        })
		});
		
	</script>
</head>
<body>
<!--<a href="http://cdn2.parllay.cn/2016090616/gw829o1ckpkcw.mp4" class="player" style="position:relative; z-index:1000000;display:block;width:425px;height:300px;margin:10px auto" id="player"></a>-->
<div id="wrapper"></div>
<div id="realtime"></div>
<div id="toast" style="display: none;">
    <div class="weui_mask_transparent"></div>
    <div class="weui_toast">
        <i class="weui_icon_toast"></i>
        <p class="weui_toast_content">服务器错误，请稍后再试</p>
    </div>
</div>
<div id="toast2" style="display: none;">
    <div class="weui_mask_transparent"></div>
    <div class="weui_toast">
        <i class="weui_icon_toast"></i>
        <p class="weui_toast_content">上传成功，已提交给管理员审核</p>
    </div>
</div>
<script type="text/javascript" src="/js/jQuery-2.1.4.min.js"></script>
<script type="text/javascript" src="/js/moment.min.js"></script>
<script type="text/javascript" src="/js/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="/js/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript" src="/js/underscore.min.js"></script>
<script type="text/javascript" src="/js/backbone.min.js"></script>
<script type="text/javascript" src="/js/react-with-addons.js"></script>
<script type="text/javascript" src="/js/react-dom.min.js"></script>
<script type="text/javascript" src="/dashboard/js/async.min.js"></script>
<!--<script src="https://unpkg.com/react-motion/build/react-motion.js"></script>-->
<script type="text/javascript" src="/js/helper.js"></script>
<script type="text/javascript" src="/js/comment.js"></script>
<script type="text/javascript" src="/js/setting.js"></script>
<script type="text/javascript" src="/js/<%= is_phone?wall.template:'mainlist' %>-template.js"></script>
<script type="text/javascript" src="/js/index.js"></script>
<script type="text/javascript">
	if(wxError !== 'No error') {
		$.ajax({
			type: 'post',
			url: '/wechat/report_error',
			data: {
				error: wxError
			}
		})
	}
</script>
<script>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
	ga('create', 'UA-46105991-4', 'auto');
	ga('send', 'pageview');
</script>
<script>
	/*(function(i,s,o,g){fuca=[],fucb=[];i.fht=function(){fuca.push(arguments)};i.fa=function(){fucb.push(arguments)};a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=0;a.src=g;a.onload=function(){fuca.forEach(function(i){fht.apply(null,i)});fucb.forEach(function(i){fa.apply(null,i)})};m.parentNode.insertBefore(a,m)})(window,document,'script','http://cdn-ppe.parllay.cn/libs/tracking.js');
  	fht('create','fht44ca6d67adfb31a0-1','auto');
	fa('add',{wall_user_id:wallUserId,wall_id:wallId});
	fa('send','page-view',encodeURIComponent(location.href))*/
</script>
</body>
</html>
